Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/ota/Esp32OtaRoutingTest.kt 9fa9f1e341ee8d2c8fd9fabf9253b2f012fc8c95 (9fa9f1e3) Text, 1.67 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.firmware.ota

Tff7b72import T7ee787kotlin.test.Test
Tff7b72import T7ee787kotlin.test.assertFalse
Tff7b72import T7ee787kotlin.test.assertTrue

T8b949e/** Verifies BLE-vs-WiFi target routing in [Esp32OtaUpdateHandler] — specifically that IPv6 literals route to WiFi. */
Tff7b72class T56d364Esp32OtaRoutingTest Tb4b4b4{

Tf0883e@Test
Tff7b72fun Td2a8ff`MAC address is a BLE target`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3assertTrueTb4b4b4(Te6edf3isBleMacAddressTb4b4b4(Ta5d6ff"Ta5d6ffAA:BB:CC:DD:EE:FFTa5d6ff"Tb4b4b4)Tb4b4b4)
Te6edf3assertTrueTb4b4b4(Te6edf3isBleMacAddressTb4b4b4(Ta5d6ff"Ta5d6ff00:11:22:33:44:55Ta5d6ff"Tb4b4b4)Tb4b4b4)
Tb4b4b4}

Tf0883e@Test
Tff7b72fun Td2a8ff`IPv4 address is not a BLE target`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3assertFalseTb4b4b4(Te6edf3isBleMacAddressTb4b4b4(Ta5d6ff"Ta5d6ff192.168.1.100Ta5d6ff"Tb4b4b4)Tb4b4b4)
Tb4b4b4}

Tf0883e@Test
Tff7b72fun Td2a8ff`IPv6 literal is not a BLE target`Tb4b4b4(Tb4b4b4) Tb4b4b4{
T8b949e// The bug this guards: an IPv6 literal carries colons but must route to WiFi, not be mistaken for a MAC.
Te6edf3assertFalseTb4b4b4(Te6edf3isBleMacAddressTb4b4b4(Ta5d6ff"Ta5d6fffe80::1Ta5d6ff"Tb4b4b4)Tb4b4b4)
Te6edf3assertFalseTb4b4b4(Te6edf3isBleMacAddressTb4b4b4(Ta5d6ff"Ta5d6ff2001:db8::ff00:42:8329Ta5d6ff"Tb4b4b4)Tb4b4b4)
Tb4b4b4}

Tf0883e@Test
Tff7b72fun Td2a8ff`hostname is not a BLE target`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3assertFalseTb4b4b4(Te6edf3isBleMacAddressTb4b4b4(Ta5d6ff"Ta5d6ffmeshtastic.localTa5d6ff"Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.04s